<template>
    <div>
        <el-header style="box-shadow: rgba(0, 0, 0, 0.05) 0px 2px 20px 0.5px;border-radius:6px;padding:20px;height:54px">
              <el-breadcrumb separator="/">
                  <el-breadcrumb-item :to="{ path: '/home' }"
                  >首页</el-breadcrumb-item>
                  <el-breadcrumb-item>人事调动</el-breadcrumb-item>
                  <el-breadcrumb-item>我的转科</el-breadcrumb-item>
              </el-breadcrumb>
        </el-header>
        <el-main style="box-shadow: rgba(0, 0, 0, 0.05) 0px 2px 20px 0.5px;border-radius:6px;margin-top:10px">
          <el-card shadow="never">
            <el-row :gutter="0" type="flex" justify="space-between">
              <label class="el-form-item__label"><el-tag size="medium">{{name}}</el-tag></label>
              <label class="el-form-item__label">科室：<el-tag type="info">{{dept}}</el-tag></label>
              <label class="el-form-item__label">片区：<el-tag type="warning">{{dict}}</el-tag></label>
            </el-row>
          </el-card>

            <el-divider></el-divider>
          <el-card>
            <el-row :gutter="0" type="flex" justify="space-between">
              <label class="el-form-item__label">转科档案</label>
              <span>
                    <label class="el-form-item__label">选择年份</label>
                    <el-date-picker></el-date-picker>
                </span>
            </el-row>
            <el-table
              :data="tableData"
              border
              height="480"
              style="width: 100%;margin-top:20px"
              :header-cell-style="{ background: 'rgb(245,247,250)' }"
            >
              <el-table-column
                label="时间"
                align="center">
                <template slot-scope="scope">{{scope.row.start_date}}-{{scope.row.end_date}}</template>
              </el-table-column>
              <el-table-column
                prop="dept"
                label="科室"
                align="center">
              </el-table-column>
              <el-table-column
                prop="duties"
                label="职务"
                align="center">
              </el-table-column>
              <el-table-column
                prop="level"
                label="层级"
                align="center">
              </el-table-column>
              <el-table-column
                label="科室考评"
                align="center">
                <template slot-scope="scope">
                  <el-tag v-if="scope.row.evaluate=='0'" type="success">优秀</el-tag>
                  <el-tag v-if="scope.row.evaluate=='1'" >良好</el-tag>
                  <el-tag v-if="scope.row.evaluate=='2'" type="warning">及格</el-tag>
                  <el-tag v-if="scope.row.evaluate=='3'" type="danger">不及格</el-tag>
                </template>
              </el-table-column>
              <el-table-column
                label="状态"
                align="center">
                <template slot-scope="scope">
                  <el-tag disable-transitions type="info" v-if="scope.row.state=='0'">未开始</el-tag>
                  <el-tag disable-transitions v-if="scope.row.state=='1'">进行中</el-tag>
                  <el-tag disable-transitions type="warning" v-if="scope.row.state=='2'">待考评</el-tag>
                  <el-tag disable-transitions type="info" v-if="scope.row.state=='3'">已停止</el-tag>
                  <el-tag disable-transitions type="success" v-if="scope.row.state=='4'">已完成</el-tag>
                </template>
              </el-table-column>
            </el-table>
          </el-card>

        </el-main>
    </div>
</template>
<script>
import TaskManager from "../service/TaskManager";

export default {
    name:'myTrans',
    data(){
        return{
          tableData:[],
          name:"",
          dept:"",
          dict:"",
        }
    },
  methods:{
    getTurnList(){
      TaskManager.getTurnList({id:window.localStorage.id}).then((res)=>{
        console.log(res)
        this.tableData=res.data
      })
    }
  },
  mounted() {
    this.name=window.localStorage.name;
    this.dept=window.localStorage.dept;
    this.dict=window.localStorage.dept;
    this.getTurnList();
  }
}
</script>
<style scoped>

</style>
